//
//  BookSelectSheetViewModel.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 26.03.25.
//

import SwiftUI

class BookSelectSheetViewModel: KoiAccountingBaseViewModel {
    
    private let bookDao = KoiAccountingDB.standard.getBookDao()
    
    @Published var books = Array<AccountingBook>()
    
    func loadBooks() {
        DispatchQueue.global(qos: .background).async {
             let result = self.bookDao.getAllBook(uid: self.uid)
            DispatchQueue.main.async {
                self.books = result
            }
        }
    }
}
